import 'package:flutter/material.dart';

class OrderDetail extends StatefulWidget {
  const OrderDetail({super.key});

  @override
  State<OrderDetail> createState() => _OrderDetailState();
}

class _OrderDetailState extends State<OrderDetail> {
  @override
  Widget build(BuildContext context) {
    //打印传递的参数
    // ModalRoute modalRoute = ModalRoute.of(context)!;
    // print(modalRoute.settings.arguments);
    return Scaffold(
        //导航条
        appBar: AppBar(
          title: const Text('商品详情页',
              style: TextStyle(
                  fontSize: 20,
                  fontWeight: FontWeight.bold,
                  color: Colors.white)),
          backgroundColor: Colors.pink,
          centerTitle: true,
        ),
        //主体区域
        body: Container(
          width: 100,
          height: 100,
          color: Colors.white,
          child: ElevatedButton(
              onPressed: () {
                Navigator.pop(context);
              },
              child: Text('回到上一个页面')),
        ));
  }
}
